<template>
	<view class="content">
		<view class="list">
			<view class="list_item" v-for="(item,index) in listData" :key="index" @click="getDetail(item.id)">
				<image :src="imageUrl+item.shopCover" mode="" style="width: 168rpx;height:168rpx;"></image>
				<view class="list_rt">
					<view>
						{{item.shopTitle}}
						<image src="../../static/img/tj.png"  mode=""></image>
					</view>
					<view>
						<text>{{item.shopCategory}}</text>
						
					</view>
					<!-- <view >
						{{item.shopTitle}}
					</view> -->
				</view>
			</view>
			<view >
				<uni-load-more :status="loadStatus"></uni-load-more>
			</view>
		</view>
	</view>
</template>

<script>
	import myMixin from "../../static/js/mixin.js"
	export default {
		data() {
			return {
				imageUrl: "",
				listData: [],

			}
		},
		mixins: [myMixin],
		onShow() {
			this.initData();
		},
		methods: {
			//进入特别推荐详情
			getDetail(id) {
				uni.navigateTo({
					url: '../subjectSub/curriculum?id=' + id
				});
			},
			//获取列表
			initData() {
				this.$http.get('/api/dream/specialShop', {
					areaCode: this.cityCode,
					pageRow: this.pageRow,
					pageSize: this.pageSize,
				}).then((data) => {
					if (data.data.code == 200) {
						this.imageUrl = data.data.imageUrl;
						if(this.pageRow!=1){
							this.listData=this.listData.concat(data.data.result.records);
						}else{
							this.listData=data.data.result.records;
						}
						// this.listData = data.data.result.records || [];
						if (data.data.result.records.length) {
							if (this.listData.length < this.pageSize) { //判断接口返回数据量小于请求数据量，则表示此为最后一页
								this.isLoadMore = true
								this.loadStatus = 'nomore';
								
							} else {
								this.isLoadMore = false;
								this.loadStatus = 'more';
							}
						} else {
							this.isLoadMore = true
							this.loadStatus = 'nomore'
						}
					} else {
						this.listData = [];
						this.isLoadMore = true
						if (this.pageRow > 1) {
							this.pageRow -= 1
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/static/css/recommendationMore.scss'
</style>
